﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LinearAlgebra
{
    public partial class SelectionForm : Form
    {
        bool optionSelected;

        public SelectionForm()
        {
            optionSelected = false;
            InitializeComponent();
        }        
        private void ChangeVector_Click(object sender, EventArgs e)
        {
            VectorBasisChangeForm form = new VectorBasisChangeForm( );
            ShowSelectedForm( form );
        }
        private void BasisChangeMatrix_Click(object sender, EventArgs e)
        {
            MatrixBasisChangeForm form = new MatrixBasisChangeForm( );
            ShowSelectedForm( form );
        }
        private void OrthoBasis_Click(object sender, EventArgs e)
        {
            OrthagonalBasisForm form = new OrthagonalBasisForm( );
            ShowSelectedForm( form );
        }
        private void ShowSelectedForm(Form form)
        {
            form.Show( );
            form.Location = this.Location;
            optionSelected = true;
            Close( );
        }
        private void SelectionForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if(!optionSelected)
                Application.Exit( );
        }
    }
}
